package pl.edu.pk.psb.bc.dao;

import java.util.List;

import org.hibernate.Criteria;
import org.hibernate.criterion.Restrictions;
import org.springframework.stereotype.Repository;

import pl.edu.pk.psb.bc.ds.KategoriaDs;

@Repository
public class KategoriaDaoImpl extends GenericDaoImpl<KategoriaDs> implements KategoriaDao {

	public KategoriaDaoImpl() {
		super(KategoriaDs.class);
	}

	@SuppressWarnings("unchecked")
	public List<KategoriaDs> pobierzGlowneKategorie() {
		Criteria criteria = sessionFactory.getCurrentSession().createCriteria(KategoriaDs.class);

		return criteria.add(Restrictions.isNull("kategoriaNadrzedna")).list();
	}
}
